package com.binary.coder.gift.core.domain.bill.impI;

import com.binary.coder.gift.core.common.bean.PageBean;
import com.binary.coder.gift.core.domain.bill.AccountService;
import com.binary.coder.gift.core.domain.bill.model.entity.AccountBookEntity;
import com.binary.coder.gift.core.domain.bill.model.entity.AccountRecordEntity;
import com.binary.coder.gift.core.domain.bill.repository.AccountRepository;
import com.binary.coder.gift.core.interfaces.bill.dto.req.PageQueryAccountBookReq;
import com.binary.coder.gift.core.interfaces.bill.dto.req.PageQueryAccountRecordReq;
import com.binary.coder.gift.core.interfaces.bill.dto.res.PageQueryAccountBookRes;
import com.binary.coder.gift.core.interfaces.bill.dto.res.PageQueryAccountRecordRes;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author weitao
 */
@Service
public class AccountServiceImpl implements AccountService {

    @Resource
    private AccountRepository accountRepository;

    @Override
    public void saveAccountRecord(AccountRecordEntity entity) {
        accountRepository.saveAccountRecord(entity);
    }

    @Override
    public PageBean<PageQueryAccountRecordRes> pageQueryAccountRecord(PageQueryAccountRecordReq req) {
        return accountRepository.pageQueryAccountRecord(req);
    }

    @Override
    public void saveAccountBook(AccountBookEntity accountBookEntity) {
        accountRepository.saveAccountBook(accountBookEntity);
    }

    @Override
    public PageBean<PageQueryAccountBookRes> pageQueryAccountBook(PageQueryAccountBookReq req) {
        return accountRepository.pageQueryAccountBook(req);
    }
}
